import java.util.Scanner;

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String str=in.nextLine();
        char[]array=str.toCharArray();
        reverse(array,0,array.length-1);
        int right=0;
        int left=0;
        while(left<array.length){
            if(right<array.length&&array[right]!=' '){
                right++;
            }
            reverse(array,left,right-1);
            left=right+1;
            right=left;
        }
        String ans=new String(array);
        System.out.println(ans);

    }
    public static char[] reverse(char[]array,int start,int end){
        while(start<end){
            char tmp=array[start];
            array[start]=array[end];
            array[end]=tmp;
            start++;
            end--;
        }
        return array;
    }
}